package com.cyzy.controller;

import com.cyzy.dto.Result;
import com.cyzy.pojo.ClassSchedule;
import com.cyzy.service.ScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/schedule")
public class ScheduleController {

    @Autowired
    private ScheduleService scheduleService;

    @GetMapping("/showSchedule")
    private Result showSchedule(ClassSchedule classSchedule){
        List<ClassSchedule> scheduleList = scheduleService.showSchedule(classSchedule);
        return Result.ok().data("scheduleList", scheduleList);
    }
}
